<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
	<head>
		<base href="<%=basePath%>">
		<title>修改密码</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<script type="text/javascript" >
		   
		   
		   var result = "${result}";
  		   if(result=='1'){
  		 		alert("保存成功！");
  		 		document.location.href = "${ctx}/pages/user/editPwd.action";
  		   }else if(result=='2'){
  		 		alert("原密码错误！");
  		 		document.location.href = "${ctx}/pages/user/editPwd.action";
  		   }
  
		    function subForm(){
		   		var oldPwd = $("#oldPwd").val();
		   		var newPwd = $("#newPwd").val();
		   		var reNewPwd = $("#reNewPwd").val();
		   		
		   		if(checkIsNull(oldPwd)){
		   			alert("原密码不能为空");
		   			$("#oldPwd").focus();
		   			return false;
		   		}else if(checkIsNull(newPwd) || newPwd.length<6){
		   			alert("新密码不能为空,并且最少6位");
		   			$("#newPwd").focus();
		   			return false;
		   		}else if(newPwd!=reNewPwd){
		   			alert("2次密码不相同");
		   			$("#reNewPwd").focus();
		   			return false;
		   		}
		   		$("#pwdForm").submit();
		   }
		</script>
	</head>
	<body>
	<div id="body-wrapper">
		<div id="main-content">
			<div class="content-box">
				<!-- Start Content Box -->
				<div class="content-box-header">
					<h3 style="cursor: s-resize;">
						修改密码
					</h3>
					<div class="clear"></div>
				</div>
				<!-- End .content-box-header -->
				<div style="display: block;" class="content-box-content">
					<form method="post" id="pwdForm" name="pwdForm" action="${ctx}/pages/user/savePwd.action">
						<fieldset>
							<p>
								<label>
									原密码
								</label>
								<input id="oldPwd" class="text-input small-input"
									name="oldPwd" value="" type="password">
							</p>
							
							<p>
								<label>
									新密码
								</label>
								<input id="newPwd" class="text-input small-input"
									name="newPwd" value="" type="password">
							</p>
							
							<p>
								<label>
									重复新密码
								</label>
								<input id="reNewPwd" class="text-input small-input"
									name="reNewPwd" value="" type="password">
							</p>
							
							<p>
								<input class="button" value="提交" onclick="subForm();" type="button">
							</p>
						</fieldset>
						<div class="clear"></div>
						<!-- End .clear -->
					</form>
				</div>
			</div>
		</div>
		</div>
	</body>
</html>
